package edu.zut.hb.software.hospital.domain;

import edu.zut.hb.software.base.domain.BaseTreeEntity;
import lombok.Data;

import javax.persistence.*;
import java.util.Set;

@Table(name = "hospital")
@Entity
@Data
@NamedQueries({ @NamedQuery(name = "Hospital.getRoot", query = "select g from Hospital g where g.parent is null")})
public class Hospital extends BaseTreeEntity<Hospital, Long> {

    private static final long serialVersionUID = -4376674977047164142L;

    @Column(name = "name")
    private String name;

    @Column(name = "address")
    private String address;

    @Column(name = "phone")
    private String phone;

//    @OneToMany(mappedBy = "hospital", cascade = CascadeType.REMOVE, fetch = FetchType.EAGER)
//    Set<Department> departments;

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

//    public Set<Department> getDepartments() {
//        return departments;
//    }
//
//    public void setDepartments(Set<Department> departments) {
//        this.departments = departments;
//    }
}
